from django_filters.rest_framework import DjangoFilterBackend
from rest_framework.mixins import ListModelMixin

from oplatform.filters.channel import ChannelFilterSet
from oplatform.models import ChannelData
from oplatform.serializers.configuration import ChannelSerializer
from utils.rest.viewsets import GenericViewSet


class ChannelViewSet(ListModelMixin, GenericViewSet):
    queryset = ChannelData.objects.all()
    serializer_class = ChannelSerializer
    filterset_class = ChannelFilterSet
    filter_backends = (DjangoFilterBackend, )
